package com.chendongyang.www.service; //进行管理者账号的登录
import com.chendongyang.www.po.manager;
import com.chendongyang.www.dao.mLogIn;
import com.chendongyang.www.util.managerId;
import java.sql.SQLException;
import java.util.Scanner;
public class managerlogin {
    public boolean logIn() throws SQLException {
        mLogIn udi = new mLogIn();
        System.out.println("============================");
        System.out.println("请输入管理员账号");
        Scanner input = new Scanner(System.in);
        String id = input.nextLine();
        System.out.println("请输入密码");
        String code = input.nextLine();
        manager manager = new manager(id, code);
        boolean result = udi.select(manager);
        if (result) {
            System.out.println("登录成功");
            managerId.id = id;
            return true;
        } else System.out.println("账号或密码错误，登录失败");
        System.out.println("==================");
        return  false;
    }
}
